<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script>
	var date1=new Date();/*获取当前日期*/
	console.log(date1);
	var date2=new Date(123456789);/*自1970后这些秒后的日期*/
	console.log(date2);
	var date3=new Date("2021-03-03 12:49:30");/*指定日期*/
	console.log(date3);
	var date4=new Date(2021,3,3,12,50,02);/*指定日期*/
	console.log(date4);
	console.log(date1.getFullYear());/*获取年份*/
	console.log(date1.getMonth());
</script>